home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
X User Tools
/
X User Tools (O'Reilly and Associates)(1994).ISO
/
sources
/
xbmbrows
/
xbmbro31.z
/
xbmbro31
/
xbmbrowser3.1
/
xbmbrowser.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-05
|
5KB
|
141 lines
/*
*****************************************************************************
** xbmbrowser version 3.1 (c) Copyright Ashley Roll, 1992.
** FILE: xbmbrowser.h
**
** xbmbrowser is Public Domain. However it, and all the code still belong to me.
** I do, however grant permission for you to freely copy and distribute it on
** the condition that this and all other copyright notices remain unchanged in
** all distributions.
**
** This software comes with NO warranty whatsoever. I therefore take no
** responsibility for any damages, losses or problems that the program may
** cause.
*****************************************************************************
*/
#include <stdio.h> /* C library includes */
#include <X11/Xos.h> /* include some system .h files independant of OS */
#include <dirent.h>
#include <sys/stat.h>
#include <assert.h> /* for assertions in bitmap.c */
#include <X11/Xlib.h> /* X programming includes */
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xaw/Form.h> /* widget includes */
#include <X11/Xaw/Box.h>
#include <X11/Xaw/Dialog.h>
#include <X11/Xaw/MenuButton.h>
#include <X11/Xaw/SimpleMenu.h>
#include <X11/Xaw/SmeBSB.h>
#include <X11/Xaw/SmeLine.h>
#include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/List.h>
#include <X11/Xaw/Paned.h>
#include <X11/Xaw/Viewport.h>
#ifdef DO_XPMS
# include <X11/xpm.h>
#endif
/***************************************************************************
SITE SPECIFIC STUFF - EDIT TO MATCH YOUR SETUP
***************************************************************************/
/*
** The full path to the Help file.
*/
#ifndef HELPFILE
#define HELPFILE "/usr/lib/X11/xbmbrowser.help"
#endif
/*
** The full path to the default menu definition file
*/
#ifndef DEFAULT_RC_FILE
#define DEFAULT_RC_FILE "/usr/lib/X11/xbmbrowser.menu"
#endif
/*
** The name of the menu definition file to look for in the users home directory
*/
#ifndef HOME_DIR_FILE
#define HOME_DIR_FILE ".xbmbrowserrc"
#endif
/***************************************************************************
PROGRAM STUFF - CHANGE IT AT YOUR OWN RISK
***************************************************************************/
enum FileType { /* the various types of file we deal with */
Bad, Dir, File, Xbm, Xpm, BadXpm,
NumFileTypes /* this is not a file type, just a count of file types */
};
typedef struct _item {
char fname[255]; /* filename in directory - widgets label */
char info[80]; /* information line to display */
time_t mtime; /* last modification time */
enum FileType type; /* file type */
Pixmap bitmap; /* bitmap from this file - to widget */
int index; /* widget the bitmap is currently in */
#ifdef DO_XPMS
XpmAttributes attr; /* xpm attributes -- colors to free */
#endif
struct _item *next; /* next item */
} Item;
#ifdef MAIN
#define ext
#else
#define ext extern
#endif
ext char dname[256]; /* current directory path */
ext char label_info[256]; /* label to show when outside bitmap */
ext char *bitmap_info; /* information of the current widget */
ext Cursor normalCursor, waitCursor; /* Cursours */
ext Widget toplevel, mainpw, bfw, bw, lw, phw, atw, menu; /* Widgets */
ext Widget dirPopup,dirList; /* directory popup widgets */
ext int ac; /* argc copy */
ext char **av; /* argv copy */
ext int dialogs_made; /* has the dialog widgets been made */
ext Pixmap stipple; /* the stipple bitmap pattern */
/* external callback procedures */
extern void DoQuit();
extern void Ok();
extern Widget MakeMenu();
extern Widget AddMenuItem();
extern void Show_Help();
extern void Inform_User();
extern void SetWindowIcon();
extern void set_name();
extern void set_label();
extern void rescan();
extern void destroy_Callback();
extern void change_dir();
extern void dir_menu();
/* miscelanous functions */
extern void setup_dialog();
extern void pos_dir();
extern Item *get_files();
/* external routines from bitmap.c module */
extern Item *alloc_item();
extern Item *free_item();
extern void free_list();
extern void scan_bitmaps();
extern void rescan_bitmaps();
/* some external variables */
extern char Translations[];